package com.example.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.dao.CategoryDao;
import com.example.domain.Category;
import com.example.service.CategoryServicce;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CategoryServiceImpl extends ServiceImpl<CategoryDao, Category> implements CategoryServicce {
    @Autowired
    private CategoryDao categoryDao;
    @Override
    public List<Category> getCategorylists(int pagecount, int pageSize) {
        return categoryDao.getCategorylists(pagecount,pageSize);
    }

    @Override
    public Long selectcount() {
        return categoryDao.selectcount();
    }

    @Override
    public Category selectcategorybyname(Category category) {
       return categoryDao.selectcategorybyname(category);
    }

    @Override
    public void addCategory(Category category) {
        categoryDao.addCategory(category);
    }

    @Override
    public void deletecategory(Long ids) {
        categoryDao.deleteCategory(ids);
    }

    @Override
    public void updatebyid(Category category) {
        categoryDao.updatebyid(category);
    }

    @Override
    public List<Category> getCategoryList(int type) {
        return categoryDao.getCategoryList(type);
    }

    @Override
    public Category selectbycategoryId(Long categoryId) {
        return categoryDao.selectbycategoryId(categoryId);
    }

    @Override
    public List<Category> selectall() {
        return categoryDao.selectall();
    }
}
